package com.ninetaildemonfox.zdl.socialproject.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ninetaildemonfox.zdl.socialproject.R;

import java.util.List;
import java.util.Map;

/**
 * 创建人： Nine tails fox
 * 创建时间： 2019/8/5
 * 功能描述：
 * 联系方式：1037438704@qq.com
 *
 * @author NineTailDemonFox
 */

public class VipAdapter extends BaseQuickAdapter<Map<String,String>,BaseViewHolder>{

    public VipAdapter(int layoutResId, @Nullable List<Map<String, String>> data) {
        super(layoutResId, data);
    }

    public VipAdapter(int list_vip_adp) {
        super(list_vip_adp);
    }

    @Override
    protected void convert(BaseViewHolder helper, Map<String, String> item) {
        helper.setText(R.id.text_price,item.get("time")).setText(R.id.text_time,item.get("price")+"元/月");
        LinearLayout llBg = helper.itemView.findViewById(R.id.ll_bg);
        TextView text_price = helper.itemView.findViewById(R.id.text_price);
        TextView text_time = helper.itemView.findViewById(R.id.text_time);
        TextView text_top = helper.itemView.findViewById(R.id.text_top);
        if (item.get("count").equals("1")){
            llBg.setBackgroundResource(R.drawable.drawable_bg_false);
            text_price.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
            text_time.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
            text_top.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
        }else {
            llBg.setBackgroundResource(R.drawable.drawable_bg_true);
            text_price.setTextColor(mContext.getResources().getColor(R.color.white));
            text_time.setTextColor(mContext.getResources().getColor(R.color.white));
            text_top.setTextColor(mContext.getResources().getColor(R.color.white));

        }

    }
}
